import 'package:demo/app/modules/main/main_controller.dart';
import 'package:get/get.dart';

import '../../../routes/app_pages.dart';
import '../../login/login_controller.dart';

class HomeController extends MainController {

  /// 开发设置，例如代理
  var lastPressTime = 0;
  var clickNum = 0;
  void toDevSetting(){
    final currentTime = DateTime.now();
    int timestamp = currentTime.millisecondsSinceEpoch;
    if(timestamp - lastPressTime > 1000){
      lastPressTime = 0;
      clickNum = 0;
    }
    if(clickNum == 2 && timestamp - lastPressTime < 1000){
      Get.toNamed(Routes.PRIVATE_SETTING);
    }else{
      if(lastPressTime == 0){
        lastPressTime = timestamp;
      }
      clickNum++;
    }
  }
}
